1. Technical Field
The present invention relates generally to an improved data processing system and in particular to an improved method and apparatus for processing requests at a data processing system. Still more particularly, the present invention relates to a method and apparatus for processing multiple requests from a client at a server in a distributed data processing system.
2. Description of Related Art
The Internet, also referred to as an xe2x80x9cinternetworkxe2x80x9d, is a set of computer networks, possibly dissimilar, joined together by means of gateways that handle data transfer and the conversion of messages from the sending network to the protocols used by the receiving network (with packets if necessary). When capitalized, the term xe2x80x9cInternetxe2x80x9d refers to the collection of networks and gateways that use the TCP/IP suite of protocols.
The Internet has become a cultural fixture as a source of both information and entertainment. Many businesses are creating Internet sites as an integral part of their marketing efforts, informing consumers of the products or services offered by the business or providing other information seeking to engender brand loyalty. Many federal, state, and local government agencies are also employing Internet sites for informational purposes, particularly agencies which must interact with virtually all segments of society such as the Internal Revenue Service and secretaries of state. Providing informational guides and/or searchable databases of online public records may reduce operating costs. Further, the Internet is becoming increasingly popular as a medium for commercial transactions.
Currently, the most commonly employed method of transferring data over the Internet is to employ the World Wide Web environment, also called simply xe2x80x9cthe Webxe2x80x9d. Other Internet resources exist for transferring information, such as File Transfer Protocol (FTP) and Gopher, but have not achieved the popularity of the Web. In the Web environment, servers and clients effect data transaction using the Hypertext Transfer Protocol (HTTP), a known protocol for handling the transfer of various data files (e.g., text, still graphic images, audio, motion video, etc.). Information is formatted for presentation to a user by a standard page description language, the Hypertext Markup Language (HTML). In addition to basic presentation formatting, HTML allows developers to specify xe2x80x9clinksxe2x80x9d to other Web resources identified by a Uniform Resource Locator (URL). A URL is a special syntax identifier defining a communications path to specific information. Each logical block of information accessible to a client, called a xe2x80x9cpagexe2x80x9d or a xe2x80x9cWeb pagexe2x80x9d, is identified by a URL. The URL provides a universal, consistent method for finding and accessing this information, not necessarily for the user, but mostly for the user""s Web xe2x80x9cbrowserxe2x80x9d. A browser is a program capable of submitting a request for information to a data source or server, such as a data source identified by a URL at the client machine. Retrieval of information on the Web is generally accomplished with an HTML-compatible browser. The Internet also is widely used to transfer applications to users using browsers. With respect to commerce on the Web, individual consumers and business use the Web to purchase various goods and services. In offering goods and services, some companies offer goods and services solely on the Web while others use the Web to extend their reach.
Users exploring the Web have discovered that the content supported by HTML document format on the Web was too limited. Users desire an ability to access applications and programs, but applications were targeted towards specific types of platforms. As a result, not everyone could access applications or programs. This deficiency has been minimized though the introduction and use of programs known as xe2x80x9cappletsxe2x80x9d, which may be embedded as objects in HTML documents on the Web. Applets are Java programs that may be transparently downloaded into a browser supporting Java along with HTML pages in which they appear. These Java programs are network and platform independent. Applets run the same way regardless of where they originate or what data processing system onto which they are loaded.
Java(trademark) is an object oriented programming language and environment focusing on defining data as objects and the methods that may be applied to those objects. Java supports only a single inheritance, meaning that each class can inherit from only one other class at any given time. Java also allows for the creation of totally abstract classes known as interfaces, which allow the defining of methods that may be shared with several classes without regard for how other classes are handling the methods. Java provides a mechanism to distribute software and extends the capabilities of a Web browser because programmers can write an applet once and the applet can be run on any Java enabled machine on the Web.
Servers today, in particular HTTP web servers, will process any request the server receives on a HTTP socket. A user, by using the stop and reload browser controls, can cause multiple requests to be sent to the web server before the web server has completed the processing of previously sent requests. The web server processing of a request may require large amounts of cpu time or memory. The simultaneous processing of multiple requests of this type for a single user may degrade web server responsiveness for other users of the web server or in extreme situations cause the web server to fail because it ran out of memory.
Therefore, it would be advantageous to have an improved method and apparatus for detecting and processing multiple requests from a single user.
The present invention provides a method and apparatus in a distributed data processing system for processing requests for documents. A request is received from a user for a selected page at a server. The selected page is returned to the user with a unique token, wherein each user is sent a unique token. Responsive to receiving a new request for a page, a determination is made as to whether the new request includes the unique token. Responsive to receiving the new request including the unique token, a determination is made as to whether a previous request from this user is simultaneously being processed by the server. Responsive to a new request having been received for a document while another prior request is pending, the new request is processed by either rejecting the new request, or by canceling the previous request and processing the new request, or by delaying the processing of the new request until the previous request has completed.